{include file="news/header.tpl"}


	{literal}
	<script type='text/javascript'>

function bind(){
	var key=$("#key").val();
	var remark=$("#remark").val();
	var attribute=$("#attribute").val();
	var module=$('input[name="module"]:checked').val();
    var status=$('input[name="status"]:checked').val();
	var s=$('input[name="status"]:checked +span').text();

	$.post("/news/attr",{key:key,name:remark,module:module,attribute:attribute,status:status},function(data){
     if(data.status==false){
alert(data.error);
         }else{
alert(data.error);
$("#ctitle").after('<tr><td class=left><img src="/static/news/images/new.gif"></td><td >'+key+'</td><td class=left>'+remark+'</td><td >'+attribute+'</td><td class=left>'+module+'</td><td >'+s+'</td></tr>');
             }
	},"json")
	
}
	   
  </SCRIPT>

{/literal}


<!-- 头部// -->
{include file="news/top.tpl"}


{include file="news/nav.tpl"}

<!-- start: Content -->
			<div id="content" class="span10">
			
						
			<div class="row-fluid">


<div class="box span12"><!-- Default panel contents -->

<div class="box-header" data-original-title="">

<h2><i class="icon-user"></i><span class="break"></span>字段扩展</h2>
						<div class="box-icon">
							<a href="#" class="btn-setting"><i class="icon-wrench"></i></a>
							<a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn-close"><i class="icon-remove"></i></a>
						</div>
					</div>

<div class="box-content">
<table class=table>



<form action="/attr/attr" method="post" >

<tr>
<td >字段名称</td>
<td  >
<select name="filed">
{foreach from=$attr item=l}
<option value="{$l.id}">{$l.name}[{$l.key}]</option>
{/foreach}
</select>
</td><td class=left><td ></td><td class=left></td><td ></td>
</tr>

<tr>
<td >添加值</td>
<td  ><input name="name" value="" id="remark">(长度50个字符)</td>
</td><td class=left><td ></td><td class=left></td><td ></td>
</tr>


<tr>
<td ></td>
<td  >
<input type="button" name="add"  value="添加"  onclick="return bind()" class="btn btn-primary"></input></td><td class=left></td><td ></td>
<td class=left></td><td ></td>
</form>
</tr>


<tr class="title" id="ctitle"><th>序号</th><th>字段名</th><th>备注名</th><th>类型</th><th>实体</th><th>状态</th></tr>
{foreach from=$extend item=l}
<tr><td class=left>{$l.eid}</td>
<td >{$l.key}</td>
<td class=left>{$l.name}</td>
<td >{$l.type}</td>
<td class=left>{$l.module}</td>
<td >
{if $l.status==1}显示{elseif $l.status==2}图片{elseif $l.status==3}多个{else}隐藏{/if}</td>
</tr>
{/foreach}

</table>
</div>
</div>
</div>
